#!/bin/sh

#
# Test that printing an error message works
#

. "$(cd "$(dirname "$0")" && pwd)/common.sh"

cat >$CONFIG <<EOF

task complete {
    on-init {
        error("Don't run this")
    }
}
EOF

$FWUP_CREATE -c -f $CONFIG -o $FWFILE

# Check that the verify logic works on this file
$FWUP_VERIFY -V -i $FWFILE

# Check that it fails to apply
if $FWUP_APPLY -a -d $IMGFILE -i $FWFILE -t complete; then
    echo "Expected this to fail, but it didn't."
    exit 1
fi

